package com.cbs.android.module.discussion.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by broche on 10/6/15.
 */
public class Comment { // 评论
    private int id; // 评论id
    private int forumid; // 板块id
    private int subjectid; // 主题id
    private int senderid; // 发件人id
    private String sendernickname; // 发件人昵称
    private int sendersex; // 发件人性别
    private String senderavatar; // 发件人头像
    private int timestamp; // 时间戳
    private String content; // 内容
    private int replycount; // 回复数
    private int starcount; // 点赞数
    private List<Reply> replies; // 回复列表
    private List<Star> stars = new ArrayList<>(); // 点赞用户列表

    public int getId() {
        return id;
    }

    public Comment setId(int id) {
        this.id = id;
        return this;
    }

    public int getForumId() {
        return forumid;
    }

    public Comment setForumId(int forumId) {
        this.forumid = forumId;
        return this;
    }

    public int getSubjectId() {
        return subjectid;
    }

    public Comment setSubjectId(int subjectId) {
        this.subjectid = subjectId;
        return this;
    }

    public int getSenderId() {
        return senderid;
    }

    public Comment setSenderId(int senderId) {
        this.senderid = senderId;
        return this;
    }

    public String getSenderNickName() {
        return sendernickname;
    }

    public Comment setSenderNickName(String senderNickName) {
        this.sendernickname = senderNickName;
        return this;
    }

    public int getSenderSex() {
        return sendersex;
    }

    public Comment setSenderSex(int senderSex) {
        this.sendersex = senderSex;
        return this;
    }

    public String getSenderAvatar() {
        return senderavatar;
    }

    public Comment setSenderAvatar(String senderAvatar) {
        this.senderavatar = senderAvatar;
        return this;
    }

    public int getTimestamp() {
        return timestamp;
    }

    public Comment setTimestamp(int timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    public String getContent() {
        return content;
    }

    public Comment setContent(String content) {
        this.content = content;
        return this;
    }

    public int getStarCount() {
        return starcount;
    }

    public Comment setStarCount(int starCount) {
        this.starcount = starCount;
        return this;
    }

    public int getReplyCount() {
        return replycount;
    }

    public Comment setReplyCount(int replyCount) {
        this.replycount = replyCount;
        return this;
    }

    public List<Reply> getReplies() {
        return replies;
    }

    public Comment setReplies(List<Reply> replies) {
        this.replies = replies;
        return this;
    }

    public Comment addReply(Reply reply) {
        if (this.replies == null) {
            this.replies = new ArrayList<>();
        }
        this.replies.add(reply);
        return this;
    }

    public Comment removeReply(Reply reply) {
        if (this.replies != null) {
            this.replies.remove(reply);
        }
        return this;
    }

    public List<Star> getStars() {
        return stars;
    }

    public Comment setStars(List<Star> stars) {
        this.stars = stars;
        return this;
    }

    public Comment addStar(Star star) {
        if (this.stars == null) {
            this.stars = new ArrayList<>();
        }
        this.stars.add(star);
        return this;
    }

    public Comment removeStar(Star star) {
        if (this.stars != null) {
            this.stars.remove(star);
        }
        return this;
    }
}
